﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BPM.Entity;
using System.Data.Entity.ModelConfiguration;

namespace BPM.Service.Mappings
{
	internal class RoleConfiguration : EntityConfiguration<Role>
	{
		public RoleConfiguration()
		{
			this.HasRequired(r => r.Barcode)
				.WithMany()
				.HasConstraint((r, b) => r.BarcodeId == b.Id)
				.WillCascadeOnDelete(false);

			////this.MapSingleType().ToTable("Roles");
			////this.MapSingleType(r => new
			////{
			////    r.Id,
			////    r.Name,
			////    r.BarcodeId
			////}).ToTable("Roles");
		}
	}
}
